package org.budo.daman.zookeeper;

import java.util.List;

import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;

/**
 * 
 * @author lmw https://blog.csdn.net/u010398771/article/details/82420504
 */
public class BudoDamanZookeeper {
    public static void main(String[] args) throws Throwable {
        String connectString = "172.16.100.57:12181";
        int sessionTimeout = 1000;
        Watcher watcher = new BudoDamanZookeeperWatcher();

        ZooKeeper zooKeeper = new ZooKeeper(connectString, sessionTimeout, watcher);
        System.err.println(zooKeeper);

        List<String> list = zooKeeper.getChildren("/", true);
        for (String each : list) {
            System.err.println(each);
        }
    }
}